/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author 839398
 */
@Entity
@Table(name = "tbl_cuota")
@NamedQueries({
    @NamedQuery(name = "TblCuota.findAll", query = "SELECT t FROM TblCuota t"),
    @NamedQuery(name = "TblCuota.findByIdCuota", query = "SELECT t FROM TblCuota t WHERE t.idCuota = :idCuota"),
    @NamedQuery(name = "TblCuota.findByFecha", query = "SELECT t FROM TblCuota t WHERE t.fecha = :fecha")})
public class TblCuota implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_cuota")
    private Integer idCuota;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @JoinColumns({
        @JoinColumn(name = "natillera", referencedColumnName = "cod_natillera"),
        @JoinColumn(name = "persona", referencedColumnName = "doc_persona")})
    @ManyToOne(optional = false)
    private TblNatilleraPersona tblNatilleraPersona;
    @JoinColumn(name = "concepto", referencedColumnName = "id_concepto")
    @ManyToOne(optional = false)
    private TblConcepto concepto;

    public TblCuota() {
    }

    public TblCuota(Integer idCuota) {
        this.idCuota = idCuota;
    }

    public TblCuota(Integer idCuota, Date fecha) {
        this.idCuota = idCuota;
        this.fecha = fecha;
    }

    public Integer getIdCuota() {
        return idCuota;
    }

    public void setIdCuota(Integer idCuota) {
        this.idCuota = idCuota;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public TblNatilleraPersona getTblNatilleraPersona() {
        return tblNatilleraPersona;
    }

    public void setTblNatilleraPersona(TblNatilleraPersona tblNatilleraPersona) {
        this.tblNatilleraPersona = tblNatilleraPersona;
    }

    public TblConcepto getConcepto() {
        return concepto;
    }

    public void setConcepto(TblConcepto concepto) {
        this.concepto = concepto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCuota != null ? idCuota.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblCuota)) {
            return false;
        }
        TblCuota other = (TblCuota) object;
        if ((this.idCuota == null && other.idCuota != null) || (this.idCuota != null && !this.idCuota.equals(other.idCuota))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + idCuota;
    }
    
}
